<?php
$companyid=$session->read("companyid");
$user=$session->read('User');
//$isflag=$action->checkPermissions($user,$companyid);
$economicid=$session->read("economicid");
?>
<div class="right_side_operate_area">
	<div class="right_side_title left">
    	<h2>
    	<?php 
		$companyname=$session->read("companyname");
		$companyyear=$session->read("economicyear");
		$economicid=$session->read("economicid");
		echo $html->link($companyname,"/companys/showinfosummary/".$companyid);
		//"&nbsp;"."&nbsp;".$companyyear.'年企业融资情况';
		?>
    	</h2>
    	<div class='clear'></div>
    </div>		   
	   <?php //if($isflag){ 
			 echo '<div class="right item_add_btn" style="display:none">';
			 echo $html->link("返回", '/companys/showeconomic/'.$economicid);
			 echo '</div>'; 
			 if(classregistry::init('User')->personAuthority($user)){
			 echo '<div class="right item_add_btn">';
			 echo $html->link("添加", 'editfinanc');
			 echo '</div>';}
		     //}else{
			//	echo '<div class="right enableaction">';
			//	echo "<a>添加</a>";
			//	echo '</div>';
			//}
		 ?>
	<div class="clear"></div>
</div>
<div class="right_side_scollbar">
	<div class="detail_info_panel">
		<div class="items_list">
			<table>
				<tr>
					<th>融资渠道</th>
					<th>金额（￥）</th>
					<th>融资时间</th>
					<th>金额占股(%)</th>
					<th>融资来源</th>
					<th><?php __('Action'); ?></th>				
					<th>&nbsp;</th>
				</tr>
			<?php 
				if(!empty($comp_financs)){
					foreach ($comp_financs as $comp_financ)
					{
						$id=$comp_financ["CompFinanc"]["id"];
						echo "<tr class='per_list'>";
						$fin_channels=$comp_financ['CompFinanc']['fin_channels'];
						echo "<td>".$html->link($str->sub_len($fin_channels,20),"/companys/showfinanc/".$id."/",array("title"=>$fin_channels),null)."</td>";			
						echo "<td>".$comp_financ['CompFinanc']['money']."</td>";
						$fin_time=$comp_financ['CompFinanc']['fin_time'];
						if(!empty($fin_time)){
						$fin_time=date("Y-m-d",strtotime($fin_time));
						}
						echo "<td>".$fin_time."</td>";
						$percent = $comp_financ["CompFinanc"]["percent"];
						echo "<td>".$percent."</td>";
						echo "<td>".$comp_financ["type_id"]["value"]."</td>";
						echo "<td>";
						if(classregistry::init('User')->personAuthority($user)){		
							echo $html->link(__('Edit',true),"/companys/editfinanc/".$id);
							echo $html->link(__('Delete',true),"/companys/delfinancs/".$id,array("onclick"=>"return doaction(this)"));
						}
						echo "</td>";
						echo "</tr>";
			        }
		        }
		    ?>
			</table>
		</div>
	</div>
</div>

<?php echo $this->element('actionconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>
